﻿<%@ Page Title="Web Proveedores" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="WebProveedores._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    </asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script language="javascript">
        $(document).ready(function () {
            // THIS IS FOR HIDE ALL DETAILS ROW
            $(".SUBDIV table tr:not(:first-child)").not("tr tr").hide();
            $(".SUBDIV .btncolexp").click(function () {
                $(this).closest('tr').next('tr').toggle();
                //this is for change img of btncolexp button
                if ($(this).attr('class').toString() == "btncolexp collapse") {
                    $(this).addClass('expand');
                    $(this).removeClass('collapse');
                }
                else {
                    $(this).removeClass('expand');
                    $(this).addClass('collapse');
                }
            });
        });
    </script>
    <script language="javascript">
        function abrirImpresionDocumento(opcion) {
            window.open(opcion, '', 'width=650,height=400,top=50,left=150,status=no,resizable=no,scrollbars=no');
            return false;
        }

        function abrirImpresionDocumentoRetencion(opcion) {
            window.open(opcion, '', 'width=850,height=550,top=50,left=150,status=no,resizable=no,scrollbars=yes');
            return false;
        }
    </script>
       
    <div>        
        <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </ajaxToolkit:ToolkitScriptManager>
        <div align="center" valing="center" style="background-color: #595959; color: #FFFFFF; font-size: 18px; font-weight: bold; font-family: Arial;">Detalle de Pago a Proveedores</div>
    </div>
    <div>
    <asp:Panel ID="pnlMenu" runat="server">
            <table style="width: 100%;">
            <tr>
                <td >
                    <asp:LinkButton ID="lnkAsigSocie" runat="server" PostBackUrl="~/AsignarSociedadUsuario.aspx">Asignar Sociedad</asp:LinkButton>
                    &nbsp;
                    <asp:LinkButton ID="lnkCambClave" runat="server" PostBackUrl="~/CambiarPassword.aspx">Cambiar Clave</asp:LinkButton>
                    &nbsp;
                    <asp:LinkButton ID="lnkAdminUsua" runat="server" PostBackUrl="~/AdminUsuarios.aspx">Administrar Usuarios</asp:LinkButton>                   
                </td>
            </tr>
        </table> 
    </asp:Panel>
    </div>
    <div>
        <asp:Label ID="lblProveedor" runat="server" Text=""></asp:Label>
    </div>
    <br />
    <div style="background-color: #E4E4E8">
        <table style="width: 100%;">
            <tr>
                <td style="border-style: none; height:20px; text-align:left;">
                    <%--<asp:ImageButton ID="imgExcel" ToolTip="Exportar a MS Excel" 
                        ImageUrl="~/imagenes/excel.png" runat="server" Width="16px" Height="16px" 
                        onclick="imgExcel_Click" />
                    &nbsp;--%>
                    <asp:Label ID="lblNIF" runat="server" Text="RUC/DNI/CE: "  CssClass="textos" Visible ="false"></asp:Label>&nbsp;
                    <asp:TextBox ID="txtNIF" Width="103px" runat="server" CssClass="textos" 
                        Visible ="false"></asp:TextBox>&nbsp;  
                    <asp:Label ID="Label2" runat="server" Text="Sociedad: "></asp:Label>&nbsp;
                    <asp:DropDownList ID="ddlSociedad" Width="200px" runat="server" CssClass="textos">
                    </asp:DropDownList>
                    <asp:Label ID="Label3" runat="server" Text="Folio: "></asp:Label>&nbsp;
                    <asp:TextBox ID="txtFolio" Width="150px" runat="server" CssClass="textos"></asp:TextBox>&nbsp;  
                    <asp:Label ID="Label1" runat="server" Text="Ver desde: "></asp:Label>&nbsp;
                    <asp:TextBox ID="txtCalendar" Width="73px" runat="server" CssClass="textos" 
                        Height="16px"></asp:TextBox>&nbsp; 
                    <asp:ImageButton ID="imgCalendar" ImageUrl="~/imagenes/calendar.png" runat="server" />
                    <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" 
                        TargetControlID="txtCalendar" PopupButtonID="imgCalendar" 
                        DaysModeTitleFormat="dd/MM/yyyy" Format="dd/MM/yyyy" 
                        TodaysDateFormat="dd/MM/yyyy">
                    </ajaxToolkit:CalendarExtender>&nbsp;

                    <asp:Label ID="Label4" runat="server" Text="hasta: "></asp:Label>&nbsp;
                    <asp:TextBox ID="txtHasta" Width="71px" runat="server" CssClass="textos" 
                        Height="17px"></asp:TextBox>&nbsp; 
                    <asp:ImageButton ID="imgCalendar2" ImageUrl="~/imagenes/calendar.png" runat="server" />
                    <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" 
                        TargetControlID="txtHasta" PopupButtonID="imgCalendar2" 
                        DaysModeTitleFormat="dd/MM/yyyy" Format="dd/MM/yyyy" 
                        TodaysDateFormat="dd/MM/yyyy">
                    </ajaxToolkit:CalendarExtender>&nbsp;


                    <asp:ImageButton ID="imgActualizar" ToolTip="Actualizar vista" 
                        ImageUrl="~/imagenes/reload.png" Width="16px" Height="16px"  runat="server" 
                        onclick="imgActualizar_Click" />&nbsp;
                    <%--<asp:ImageButton ID="imgCerrarSesion" ToolTip="Cerrar Sesión" runat="server" 
                        ImageUrl="~/imagenes/cancel.png" Width="16px" Height="16px" 
                        onclick="imgCerrarSesion_Click" />--%>
                </td>
            </tr>
        </table>
    <div >

<%--    <asp:Repeater ID="rptPager" runat="server">
        <ItemTemplate>
            <asp:LinkButton ID="lnkPage" runat="server" Text = '<%#Eval("Text") %>' 
                CommandArgument = '<%# Eval("Value") %>' Enabled = '<%# Eval("Enabled") %>' 
                OnClick = "Page_Changed"></asp:LinkButton>
        </ItemTemplate>
    </asp:Repeater>--%>
        
        Pagina
        
        <asp:DropDownList ID="DropDownList1" runat="server" 
            onselectedindexchanged="DropDownList1_SelectedIndexChanged" AutoPostBack="True">
        </asp:DropDownList>   
        &nbsp;de&nbsp;
        <asp:Label ID="lblTotalPags" runat="server" style="font-weight: 700" Text="Label"></asp:Label>
&nbsp;<asp:ListView ID="ListView1" runat="server" 
            OnItemDataBound="ListView1_ItemDataBound" 
            OnItemCommand="lstView_ItemCommand" >
            <LayoutTemplate>
                <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: 0.5px solid #000000; background-color: #006699; color: #FFFFFF; font-size: 11px;">
                    <tr>
                        <th width="15px"></th>
                        <th width="18px"></th>
                        <th width="8%">Fecha</th>
                        <th width="15%">Empresa</th>
                        <th width="10%">Form. Pago</th>
                        <th width="8%">Moneda</th>
                        <th width="8%">Importe</th>
                        <th width="15%">Banco Emisor</th>
                        <th width="14%">Banco Receptor</th>
                        <th width="15%">Cta. Bancaria</th>
                        <th>Cant.</th>
                    </tr>
                </table>
                <div runat="server" id="itemPlaceHolder"></div>
            </LayoutTemplate>
            <ItemTemplate>

                <div class="SUBDIV" runat="server">
                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="15px">
                                <div class="btncolexp collapse">
                                    &nbsp;
                                </div>
                            </td>
                            <td width="18px">
                              <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                <ContentTemplate>
                                        <asp:ImageButton ID="btnImgRet" CommandName="Retencion" 
                                        CommandArgument='<%#Eval("numero_certificado_retencion") + "|" +
                                                            Eval("codigo_sociedad") + "|" + 
                                                            Eval("annio") + "|" + 
                                                            Eval("numero_documento") + "|" +
                                                            Eval("posicion") %>' 
                                        runat="server" Width="16px" Height="16px" ImageUrl="~/imagenes/constancia.png" 
                                        Visible='<%#Eval("numero_certificado_retencion") == "" ? false : true %>'/>
                                   </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                            <td width="8%" style="text-align: center"><%#Eval("fecha_pago")%></td>
                            <td width="15%"><%#Eval("descripcion_sociedad")%></td>
                            <td width="10%"><%#Eval("forma_pago") %></td>
                            <td width="8%" style="text-align: center"><%#Eval("moneda") %></td>
                            <td width="8%" style="text-align: right"><%#Eval("importe_pago_documento", "{0:N}")%></td>
                            <td width="15%"><%#Eval("banco_emisor")%></td>
                            <td width="14%"><%#Eval("banco_receptor")%></td>
                            <td width="15%"><%#Eval("cuenta_bancaria_receptor")%></td>
                            <td style="text-align: right"><%#Eval("cant_doc") %></td>
                        </tr>
                        <tr>
                            <td colspan="11">
                                <div style="margin:20px">
                                    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                      <ContentTemplate>
                                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" HeaderStyle-BackColor="#9999FF" Font-Size="11px" HeaderStyle-ForeColor="#333333">
                                            <Columns>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="btnImg" runat="server" Width="16px" Height="16px" ImageUrl="~/imagenes/constancia.png" OnClick="addButton_Click" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField HeaderText="Tipo Doc." DataField="descripcion_tipo_documento"  HeaderStyle-Width="160px" />
                                                <asp:BoundField HeaderText="N° Documento" DataField="referencia" HeaderStyle-Width="100px" />
                                                <asp:BoundField HeaderText="N° Orden Compra" DataField="numero_orden_compra" HeaderStyle-Width="100px" />
                                                <asp:BoundField HeaderText="Moneda" DataField="moneda" HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Center" />
                                                <asp:BoundField HeaderText="Importe" DataField="importe_pago_moneda_documento" DataFormatString="{0:N}" HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Right" />
                                            </Columns>
                                        </asp:GridView>
                                     </ContentTemplate>
                                    </asp:UpdatePanel>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </ItemTemplate>
        </asp:ListView>

    </div>
            
    </div>
    
</asp:Content>
